package consumer.service;

import consumer.dao.GoodPriceDao;
import consumer.entity.GoodPrice;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import producer.entity.Good;
import producer.service.CourseListService;

import java.util.List;

@Service
public class CourseServiceImpl implements CoursePrice {
    @Autowired
    GoodPriceDao goodPriceDao;

    //    引入dubbo服务

    @Reference(version = "${demo.service.version}")
    CourseListService courseListService;


    @Override
    public List<GoodPrice> getAllPrice() {
        List<GoodPrice> allPrice = goodPriceDao.getAllPrice();
        return allPrice;
    }

    @Override
    public String getInfoByDubbo() {
        return courseListService.test();
    }
}
